import Vue from "vue";
import Vuex from "vuex";
import permission from './permission/index'
import users from './users'
import itemHeader from './itemHeader'
import preOrder from "./preOrder";



// 引入createPersistedState，做持久存储
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {},
  getters: {},
  mutations: {},
  actions: {
  },
  modules: {
    permission,
    users,
    itemHeader,
    preOrder
  },


    // vuex数据持久化配置
    plugins:[
      createPersistedState({
        storage:window.localStorage,
        key:'store',
        paths:['users','preOrder']
      })
    ]

 
});
